package cn.itsource.org.controller;

import cn.itsource.org.domain.Model;
import cn.itsource.org.domain.MyAdd;
import cn.itsource.org.domain.MyUpdate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MyController {
    @PutMapping("/test1")
    public String test1(@Validated({MyAdd.class}) @RequestBody Model model){
        return "1";
    }

    @PutMapping("/test2")
    public String test2(@Validated({MyUpdate.class}) @RequestBody Model model){
        return "1";
    }
}
